function collectionLike() {
    var user = JSON.parse(sessionStorage.getItem("user"));
    $('.fa-heart').click(function () {
        if (!user) {
            $(document).dialog({
                type : 'confirm',
                closeBtnShow: true,
                content: '您还没有登录，是否跳到登录页面',
                onClickConfirmBtn: function(){
                    window.parent.location.href="/login.html";
                }
            });
        }else{
            var strategyid = getParams().id;//攻略id
            var userid = user.id;//用户id;
            var state = 0;//收藏
            $.ajax({
                type: "PUT",
                url: "/users/"+userid+"/strategys/"+strategyid+"/"+state,
                success: function(data){
                    if (data.result.success) {
                        $('.fa-heart span:first').html(' '+data.nums);
                    }else{
                        $('.fa-heart span:first').html(' '+data.nums);
                    }
                }
            })
        }
    })
    $('.fa-thumbs-up').click(function () {
        if (!user) {
            $(document).dialog({
                type : 'confirm',
                closeBtnShow: true,
                content: '您还没有登录，是否跳到登录页面',
                onClickConfirmBtn: function(){
                    window.parent.location.href="/login.html";
                }
            });
        }else{
            var strategyid = getParams().id;//攻略id
            var userid = user.id;//用户id;
            var state = 1;//点赞
            $.ajax({
                type: "PUT",
                url: "/users/"+userid+"/strategys/"+strategyid+"/"+state,
                success: function(data){
                    if (data.result.success) {
                        $('.fa-thumbs-up span:first').html(' '+data.nums);
                    }else{
                        $('.fa-thumbs-up span:first').html(' '+data.nums);
                    }
                }
            })
        }
    })

}